import { IPSDEMethodDTO } from './ipsdemethod-dto';
import { IPSDEServiceAPI } from './ipsdeservice-api';
import { IPSDEServiceAPIMethodReturn } from './ipsdeservice-apimethod-return';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEServiceAPIMethodReturnImpl extends PSModelObjectImpl implements IPSDEServiceAPIMethodReturn {
  get codeName(): string {
    return this.M.codeName;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  protected psdemethoddto: IPSDEMethodDTO | null = null;

  getPSDEMethodDTO(): IPSDEMethodDTO | null {
    if (this.psdemethoddto != null) return this.psdemethoddto;
    const value = this.M.getPSDEMethodDTO;
    if (value == null) {
      return null;
    }
    const ipsdeserviceapi = this.getParentPSModelObject('dataentity.service.IPSDEServiceAPI') as IPSDEServiceAPI;
    if (ipsdeserviceapi != null) {
      this.psdemethoddto = ipsdeserviceapi.getPSDataEntityMust().findPSDEMethodDTO(value);
    }
    return this.psdemethoddto;
  }

  get psDEMethodDTO(): IPSDEMethodDTO | null {
    return this.getPSDEMethodDTO();
  }

  getPSDEMethodDTOMust(): IPSDEMethodDTO {
    const value = this.getPSDEMethodDTO();
    if (value == null) {
      throw new Error('未指定实体服务接口DTO对象');
    }
    return value;
  }

  get stdDataType(): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 {
    return this.M.stdDataType != null ? this.M.stdDataType : 0;
  }

  get type(): 'VOID' | 'SIMPLE' | 'SIMPLES' | 'DTO' | 'DTOS' | 'PAGE' | 'UNKNOWN' | 'USER' | 'USER2' {
    return this.M.type;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSDEServiceAPIMethodReturnImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.service.IPSDEMethodReturn' || cls == 'dataentity.service.IPSDEServiceAPIMethodReturn') return true;
    return super.instanceof(cls);
  }
}
